#include <stdio.h>
#define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <string.h>
struct Stu
{
	char name[20];
	int age;
};

int tmp_age(const void*e1, const void*e2)
{
	return ((struct Stu*)e1)->age - ((struct Stu*)e2)->age;
}

int tmp_name(const void* e1, const void* e2)
{
	return strcmp(((struct Stu*)e1)->name,((struct Stu*)e2)->name);
}

void test()
{
	struct Stu s[6] = { {"zhangsan",41},{"zhaosi",18},{"wangwu",30},{"liuqi",11},{"yeba",25},{"zhengshi",20}};
	int so = sizeof(s) / sizeof(s[0]);
	int l = sizeof(s[0]);
	/*qsort(s, so, l, tmp_age);*/
	qsort(s, so, l, tmp_name);

	int i = 0;

}

int main()
{
	test();
	return 0;
}